package org.czx.datactruct.first;

/**
 * @author czx
 * @date 2020/8/20 13:54
 */
public interface BagInterface<T> {
    /**
     * get the current size of the aray
     * @return the number of objects in the bag
     */
    int getCurrentSize();

    boolean isEmpty();

    boolean add(T newEntry);

    /**
     * 从包中删除一个项
     * 如果包为空，就返回null
     * @return
     */
    T remove();

    boolean remove(T anEntry);

    void clear();
    int getFrequencyOf(T anEntry);

    boolean contains(T anEntry);

    T[] toArray();
}
